package com.cloudcross.ssp.service;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

import com.cloudcross.ssp.base.service.IGenericService;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.BannerTemplate;

/**
 * 创意服务模板表服务接口
 * 
 * @author wuqiang.du
 */

public interface IBannerTemplateService extends IGenericService<BannerTemplate> {
    /**
     * 编辑新增创意信息
     * 
     * @param bannerTemplate
     * @param targetParamsMap
     * @return
     */
    boolean save(BannerTemplate bannerTemplate, Map<String, Object> targetParamsMap);

    boolean alterName(Map<String, Object> paramMap);

    int countByParams2(Map<String, Object> paramMap);

    int countByParams3(Map<String, Object> paramMap);

    List<BannerTemplate> findByParams2(Map<String, Object> paramMap, Pager pager);

    List<BannerTemplate> findByParams4(Map<String, Object> paramMap, Pager pager);

    boolean updataIds(BannerTemplate t);

    List<BannerTemplate> findByParams2Ext(Map<String, Object> paramMap);

    boolean deleteUpdata(List<Long> idList, int status);

    /**
     * 上传创意方法
     * 
     * @author djp
     */

    String resetName(String uploadName);

    String getLocalFilePath(String fileName);

    String replacePath(String path);

    int judgeType(String fileType);

    //生成缩略图
    void compressPicture(File localFile, String pathNew, int width, int height) throws IOException;

    //匹配广告为宽高，用取平方差最小
    BannerTemplate suitSize(int width, int height, BannerTemplate bannerTemplate);
}
